'''
Created on 2010/07/06

@author: yukiyonezawa
'''

from pyrfid.Util.Util import Util

from pyrfid.DataProtocol.DSFID.DataFormat.NotFormatted import NotFormatted
from pyrfid.DataProtocol.DSFID.DataFormat.FullFeatured import FullFeatured
from pyrfid.DataProtocol.DSFID.DataFormat.RootOIDEncoded import RootOIDEncoded
from pyrfid.DataProtocol.DSFID.DataFormat.RelatedRootOID import RelatedRootOID


class DataFormat(object):
    
    def __init__(self):
        pass    
    
    @staticmethod
    def getDataFormat(data_format_id):
        
        if data_format_id == NotFormatted.DATA_FORMAT_ID:
            return NotFormatted()
        elif data_format_id == FullFeatured.DATA_FORMAT_ID:
            return FullFeatured()
        elif data_format_id == RootOIDEncoded.DATA_FORMAT_ID:            
            return RootOIDEncoded()
        elif data_format_id >= RelatedRootOID.DATA_FORMAT_ID_MIN and data_format_id <= RelatedRootOID.DATA_FORMAT_ID_MAX:
            return RelatedRootOID(data_format_id)
        
        raise "UNDEFINED Data Format"
    